﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DataAnnotationsExtensions;
using MvcEnumDropDownList.Helpers;

namespace BenzInfo.Hockey.LHRAF.Models
{
    [Table("Games")]
    public class Game : Event
    {
        [LocalizationEnum(typeof(Resources.Models.Game))]
        public enum EndingEnum : byte
        {
            Regular = 1,
            OverTime,
            Shoutout
        }
        
        [Required]
        public virtual Team HomeTeam { get; set; }

        [Required]
        public virtual Team AwayTeam { get; set; }
        
        [Required]
        [Display(Name = "DisplayHomeScore", ResourceType = typeof(Resources.Models.Game))]
        public int HomeScore { get; set; }

        [Required]
        [Display(Name = "DisplayAwayScore", ResourceType = typeof(Resources.Models.Game))]
        public int AwayScore { get; set; }

        [Required]
        [EnumDataType(typeof(EndingEnum))]
        public int EndingValue { get; set; }

        [Display(Name = "DisplayEnding", ResourceType = typeof(Resources.Models.Game))]
        public EndingEnum GameEnding
        {
            get { return (EndingEnum)EndingValue; }
            set { EndingValue = (int)value; }
        }
    }
}